﻿#region Using Statements
using System;
using Microsoft.Xna.Framework;
#endregion

namespace BubbleSurvival
{
    /// <summary>
    /// The options screen is brought up over the top of the main menu
    /// screen, and gives the user a chance to configure the game
    /// in various hopefully useful ways.
    /// </summary>
    class OptionsMenuScreen : MenuScreen
    {
        #region Initialization


        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public OptionsMenuScreen()
            : base("Options")
        {
            // Create our menu entries.
            MenuEntry gameOptionsMenuMenuEntry = new MenuEntry("Game");
            MenuEntry videoOptionsMenuMenuEntry = new MenuEntry("Video");
            MenuEntry ControlsMenuMenuEntry = new MenuEntry("Controls");
            MenuEntry backMenuEntry = new MenuEntry("Back");

            // Hook up menu event handlers.
            gameOptionsMenuMenuEntry.Selected += GameOptionsMenuEntrySelected;
            videoOptionsMenuMenuEntry.Selected += VideoOptionsMenuEntrySelected;
            ControlsMenuMenuEntry.Selected += ControlsMenuEntrySelected;
            backMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(gameOptionsMenuMenuEntry);
            MenuEntries.Add(videoOptionsMenuMenuEntry);
            MenuEntries.Add(ControlsMenuMenuEntry);
            MenuEntries.Add(backMenuEntry);
        }


        #endregion

        #region Handle Input


        /// <summary>
        /// Event handler for when the Play Game menu entry is selected.
        /// </summary>
        void GameOptionsMenuEntrySelected(object sender, EventArgs e)
        {
            ScreenManager.AddScreen(new GameOptionsMenuScreen());
        }


        /// <summary>
        /// Event handler for when the Breadth First menu entry is selected.
        /// </summary>
        void VideoOptionsMenuEntrySelected(object sender, EventArgs e)
        {
            ScreenManager.AddScreen(new VideoOptionsMenuScreen());
        }


        /// <summary>
        /// Event handler for when the Depth First menu entry is selected.
        /// </summary>
        void ControlsMenuEntrySelected(object sender, EventArgs e)
        {
            ScreenManager.AddScreen(new ControlsOptionsMenuScreen());
        }


        #endregion
    }
}
